﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Phatent.Model.Pages;
using Phatent.Command.Pages;
namespace Phatent.Logic.Pages
{
    public class PageLogic
    {
        public static PageCollection Gets(PageQuery sea)
        {
            return PageCommand.Gets(sea);
        }

        public static PageModel GetPage(int id)
        {
            return PageCommand.GetPage(id);
        }

        public static PageModel CreateNewPage(PageModel model)
        {
            model.CreatedOn = DateTime.Now;
            return PageCommand.CreateNewPage(model);
        }

        public static void UpdatePage(PageModel model)
        {
            PageCommand.UpdatePage(model);
        }

        public static void DeletePage(int id)
        {
            PageCommand.DeletePage(id);
        }

        public static PageModel GetTopPage(int caseID)
        {
            return PageCommand.GetTopPage(caseID);
        }

        public static PageModel GetPage(int caseID, string title)
        {
            return PageCommand.GetPage(caseID, title);
        }
    }
}
